package com.goktech.service.imp;

import com.goktech.entity.Book;
import com.goktech.entity.User;
import com.goktech.entity.collect;
import com.goktech.mapper.CollectMapper;
import com.goktech.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("CollectService")
public class collectServiceImp implements CollectService {

    @Autowired
    CollectMapper collectMapper;
    @Override
    public int insertCollect(collect c) {
        return collectMapper.insertCollect(c);
    }

    @Override
    public collect findByCollectOne(collect c) {
        return collectMapper.findByCollectOne(c);
    }

    @Override
    public List<Map<String, Object>> selectAll(User u,int begin,int end) {
        return collectMapper.selectAll(u,begin,end);
    }

    @Override
    public List<Map<String, Object>> findByLikeBookName(User u, Book b) {
        return collectMapper.findByLikeBookName(u,b);
    }

    @Override
    public List<Map<String, Object>> findByLikeAuthor(User u, Book b) {
        return collectMapper.findByLikeAuthor(u,b);
    }

    @Override
    public int deleteCollect(collect c) {
        return collectMapper.deleteCollect(c);
    }


    @Override
    public int deleteCollect1(User user){
        return collectMapper.deleteCollect1(user);
    }
}
